Skip to main content

Behavior Actions

IO River supports a variety of actions that can be added to a behavior, including the following:

Cache Behavior

This action controls whether content should be cached by the CDN.

Arguments:

  • Behavior - Select either Cache or Bypass.

Cache TTL

This action specifies the duration the CDN is allowed to keep content in the cache. When the TTL expires, the CDN will attempt to revalidate the content using an IMS request.

Arguments:

  • Cache TTL - Duration in seconds.

Browser Cache TTL

This action controls how long the browser is allowed to cache the content. The CDN will add a Cache-Control header to the response sent to end-users with the configured cache TTL.

Arguments:

  • Cache TTL - Duration in seconds.

Cache Key

This action provides control over how content is stored in the CDN cache. You can select the components of the cache key used to store objects in the CDN cache. For example, if you specify the Origin header as part of the cache key, the CDN will store different copies of the response in the cache for different values of Origin in the request header.

Arguments:

  • Headers - List of headers to be included in the cache key. Select Include to specify a list of headers, or None to exclude all headers.
  • Query Strings - List of query string parameters to include or exclude in the cache key. You can also choose to include all or none.
  • Cookies - List of cookies to include in the cache key. Select Include to specify a list of cookies, or None to exclude all cookies.

Status Code Cache

This action provides control over caching by status code. You can set the cache TTL for specific status codes or groups (e.g., 4xx). This action can be used to control the caching of errors.

Arguments:

  • Status Code Cache - Either a specific status code or a group of status codes.
  • Behavior - Select either Cache or Bypass.
  • Cache TTL - Duration in seconds.

Status Code Browser Cache

This action controls browser caching by status code. For specified status codes, the CDN will add a Cache-Control header to the response with the configured TTL.

Arguments:

  • Status Code Cache - Either a specific status code or a group of status codes.
  • Cache TTL - Duration in seconds.

Allowed Methods

This action controls the list of HTTP methods allowed for this service. If an end user attempts to use a disallowed method, the CDN responds with status code 405.

Arguments:

  • Allowed Methods - List of HTTP methods.

Cached Methods

This action controls the list of HTTP methods whose responses the CDN will cache.

Arguments:

  • Cached Methods - List of HTTP methods.

Compression

This action controls whether the CDN should compress responses from the origin before sending them to end users. CDN compression applies only to compressible file types.

Arguments:

  • Enabled - Flag to enable or disable compression.

Host Header Override

This action controls the Host header sent in requests to the origin. By default, the viewer's Host header is sent to the origin, but this action allows customization.

Arguments:

  • Host Header Value - The custom Host header value.
  • Use Origin Host - If checked, the origin domain will be used for the Host header.

Set Request Header

This action adds a custom header to requests sent to the origin. For setting CORS headers, use the 'Set CORS Header' action.

Arguments:

  • Header Name - Name of the header to set.
  • Header Value - Value of the header to set.

Delete Request Header

This action removes a specified header from the end-user request.

Arguments:

  • Header Name - Name of the header to delete.

Set Response Header

This action adds a custom header to the response sent to end-users.

Arguments:

  • Header Name - Name of the header to set.
  • Header Value - Value of the header to set.
  • Override - If checked, any existing header with the same name will be overridden.

Delete Response Header

This action removes a specified header from the end-user response.

Arguments:

  • Header Name - Name of the header to delete.

Set CORS Header

This action controls CORS headers added to the end-user response.

Arguments:

  • CORS Header Name - Type of CORS header.
  • Header Value - Value of the header to set.
  • Override - If checked, any existing CORS header with the same name will be overridden.

Viewer Protocol

This action controls how the CDN should respond to HTTP requests. The CDN can either accept both HTTP and HTTPS, redirect HTTP to HTTPS, or restrict access to HTTPS only. If HTTPS-only is selected, the CDN will respond with a 403 status code to HTTP requests.

Arguments:

  • Policy - Type of viewer protocol policy.

Redirect to URL

This action enables sending a redirect response with a specified URL.

Arguments:

  • Redirect to URL - URL to redirect to.

Stream Log

This action allows streaming CDN access logs to your logging destination (e.g., an S3 bucket). All logs are streamed in a unified format, regardless of the CDN generating them.

Arguments:

  • Log Destination - Storage destination for the logs. You can configure the log destination as described here.
  • Sample Rate - Percentage of logs to stream.

Generate Preflight Response

This action controls how the CDN should respond to a preflight request. The CDN can respond to a preflight request without forwarding it to the origin. You can configure the headers to include in the preflight response.

Arguments:

  • Allowed Methods - Value for the Access-Control-Allow-Methods header.
  • Max-Age - Value for the Access-Control-Max-Age header.
  • Allowed Headers - Value for the Access-Control-Allow-Headers header.

Large Files Optimization

This action controls how the CDN handles large files (over 50MB). Enable this flag if you are working with large files. When enabled, the CDN stores large file in segments within the cache.

Arguments:

  • Enabled - Flag to enable or disable large file optimization.

Origin Cache Control

This action controls whether the CDN should honor the Cache-Control header sent by the origin. By default, origin Cache-Control headers are not honored by the CDN.

Arguments:

  • Enabled - Flag to enable or disable origin cache control.

Stale TTL

This action sets the time duration the CDN can serve expired content from the cache. If the content is expired and there is a problem fetching it from the origin, the CDN can serve stale content for the specified duration.

Arguments:

  • Cache TTL - Duration in seconds.

This action allows bypassing the cache if the request contains a specified cookie.

Arguments:

  • Cookie - Name of the cookie.

Follow Redirects

This action enables the CDN to follow a redirect response from the origin. If the origin responds with a redirect, the CDN will follow it and return the response to the end user.

Arguments:

  • Enabled - Flag to enable or disable follow redirects.

Auto Minify

This action controls whether the CDN should automatically minify HTML, CSS, and JavaScript files.

Arguments:

  • Auto Minify - Flags to enable or disable auto-minification of HTML, CSS, and JavaScript.